/**
 * 配置文件
 */

let apiUrl,uploadUrl,ossUrl,url,mqttUrl;

const accountInfo = wx.getAccountInfoSync()
const envVersion = accountInfo.miniProgram.envVersion;

if (envVersion === 'release') {
    mqttUrl = "wxs://127.0.0.1/wxs";
    url = "https://127.0.0.1.top";
    ossUrl = "https://127.0.0.1.top";
}else if (envVersion === 'trial') {
    mqttUrl = "wxs://127.0.0.1/wxs";
    url = "https://127.0.0.1";
    ossUrl = "https://127.0.0.1";
} else if (envVersion === 'develop') {
    mqttUrl = "wx:127.0.0.1:8083";
    ossUrl = "http://127.0.0.1";
    url = "http://127.0.0.1:18082";
}

apiUrl = url + "/applet/";
uploadUrl = url + "/applet/upload/image";

const updateUrl = `${url}/isupdate?time=${Math.random()}`;
const blockUrl = `${apiUrl}member/applet/check/block`;

module.exports = {
    apiUrl,
    uploadUrl,
    url,
    ossUrl,
    updateUrl,
    blockUrl,
    mqttUrl,
    enMqtt : true,
}